layui.define(['layer','jquery','form','laydate'], function (exports) {
    var $ = layui.jquery;
    var layer=layui.layer;
    var laydate = layui.laydate;
    var form = layui.form();

    var index = parent.layer.getFrameIndex(window.name);

    $("#btn_callback").click(function(){
        var m_val=$(this).attr('data-id');
        layer.confirm('确定撤回此申请吗？',function(index){
            $.post("/srv/sdo.php", {tpl:"repair_callback",id:m_val}, function (d, e) {
                if(d=="ok"){
                    location.reload();
                }
            });
        });

    });
    $("#btn_evaluate").click(function(){
        var m_val=$(this).attr('data-id');
        var evaluate_val=$("#evaluate").val();
        layer.confirm('确定评价吗？',function(index){
            $.post("/srv/sdo.php", {tpl:"btn_evaluate",id:m_val,evaluate:evaluate_val}, function (d, e) {
                if(d=="ok"){
                    location.reload();
                }
            });
        });

    });
    $("#btn_add_evaluate").click(function(){
        var m_val=$(this).attr('data-id');
        var evaluate_val=$("#evaluate").val();
        layer.confirm('确定追加评价吗？',function(index){
            $.post("/srv/sdo.php", {tpl:"btn_add_evaluate",id:m_val,evaluate:evaluate_val}, function (d, e) {
                if(d=="ok"){
                    location.reload();
                }
            });
        });

    });





    
    exports('repair_detail', {});
});